package com.example.service.impl.rabbitmq.direct;

import com.example.service.MessageService;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

public class MessageRabbitmqDirectServiceImpl implements MessageService {

//    @Autowired
    private AmqpTemplate amqpTemplate;


    @Override
    public void sendMessage(String id) {
        System.out.println("加入RabbitMQ的direct模式的队列中:"+id);
        amqpTemplate.convertAndSend("direct_exchange","direct",id);
    }

    @Override
    public String doMessage() {
        return null;
    }
}
